$(function () {
    $('#phone1').on('keyup', function() {
        var phone1 = $(this).val();
        $.ajax({
            type: 'GET',
            url: 'http://localhost:8080/MyJpetStore/phoneServlet?phone1=' + phone1,
            success: function(response) {
                $('#phoneError').text(response);
            },
            error: function() {
                console.error('AJAX请求失败');
            }
        });
    });
});